package com.cls.business.service;

import com.cls.business.entity.Topic;
import com.cls.business.entity.TopicSelect;

import com.cls.business.vo.TopicSelectVO;
import com.cls.common.entity.QueryRequest;
import com.github.pagehelper.PageInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 征集选题 Service接口
 *
 * @author wmm
 * @date 2020-11-12 09:22:38
 */
public interface ITopicSelectService extends IService<TopicSelect> {
    /**
     * 查询（分页）
     *
     * @param request QueryRequest
     * @param topicSelect selectTopic
     * @return PageInfo<SelectTopic>
     */
    PageInfo<TopicSelect> findTopicSelects(QueryRequest request, TopicSelect topicSelect);

    /**
     * 给前端页面返回数据 列表
     * @param request
     * @param topicSelect
     * @return
     */
    PageInfo<TopicSelectVO> findTopicSelectsForClient(QueryRequest request, TopicSelectVO topicSelect);


    /**
     * 给前端页面返回数据 详情
     * @param topicSelectId
     * @return
     */
    TopicSelectVO findTopicDetailForClient(Long topicSelectId);

    /**
     * 把课题征集转为课题指南
     * @param ids
     */
    void changeTopics(String[] ids, Topic topic);

    List<TopicSelect> findTopicSelects(TopicSelect topicSelect);

    @Transactional(rollbackFor = Exception.class)
    void createTopicSelect(TopicSelect topicSelect);

    @Transactional(rollbackFor = Exception.class)
    void updateTopicSelect(TopicSelect topicSelect);

    @Transactional(rollbackFor = Exception.class)
    void deleteTopicSelects(String[] ids);

    void export(String year, HttpServletResponse response) throws Exception;

    void submitTopicSelect(TopicSelect topicSelect);

}
